<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
use think\Route;

//Route::bind('index/index');

Route::rule([
    '/'               => 'index',
    'index'           => 'index',
    'center'          => 'center',
    'sell'            => 'sell',
    'point'           => 'point',
    'log'             => 'log',
    'sale'            => 'sale',
    'edit'            => 'edit',
    'pass'            => 'pass',
    'msg'             => 'msg',
    'quit'            => 'quit',
    'admin'           => 'admin',
    'test/[:keyword]' => 'test',
]);

Route::post([
    'edit_submit' => 'edit_submit',
]);

//Route::domain('app','index/Index');

// 异常错误报错级别,
error_reporting(E_ALL ^ E_NOTICE);

//html转义函数
function html_special_chars($params)
{
    if (!is_array($params)) {
        return htmlspecialchars($params);
    }
    foreach ($params as $key => $val) {
        if (is_array($val)) {
            foreach ($val as $key2 => $val2) {
                if (is_array($val2)) {
                    foreach ($val2 as $key3 => $val3) {
                        if (is_array($val3)) {
                            foreach ($val3 as $key4 => $val4) {
                                if (is_array($val4)) {
                                    return $params;
                                } else {
                                    $params[$key][$key2][$key3][$key4] = htmlspecialchars($val4);
                                }
                            }
                        } else {
                            $params[$key][$key2][$key3] = htmlspecialchars($val3);
                        }
                    }
                } else {
                    $params[$key][$key2] = htmlspecialchars($val2);
                }
            }
        } else {
            $params[$key] = htmlspecialchars($val);
        }
    }
    return $params;
}